<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>添加缴费</title>
<link rel="stylesheet" href="/scriptZIP/layui.min.css">
	<link rel="stylesheet" href="../css/common2.css">
	<link rel="stylesheet" href="../css/check_box.css">
	<link rel="stylesheet" href="../css/radio.css">
	<link rel="stylesheet" href="../css/layui.css" />
</head>

<body>
	
	<br /><br />
	<div id="vue-root" class="layui-row">
		<div class="layui-col-md6 layui-col-md-offset3">
			<div class="layui-form-item">
				<label class="layui-form-label">项目名称</label>
				<div class="layui-input-block">
					<input name="name" autocomplete="off" placeholder="请输入项目名称" class="layui-input" v-model="item.name">
					<div class="checkout_state" v-text="err('name')"></div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">价格</label>
				<div class="layui-input-block">
					<input name="fee" type="number" autocomplete="off" placeholder="请输入缴费金额" class="layui-input"
						v-model="fee">
					<div class="checkout_state" v-text="err('fee')"></div>
				</div>
			</div>

			<div class="layui-form-item layui-form-item-last">
				<label class="layui-form-label">可缴费时间段</label>
				<div class="layui-input-block">
					<input name="period" :value="period" placeholder="请输入可缴费时间段" class="layui-input" id="time">
				</div>
				<div class="checkout_state" v-text="err('period')"></div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">描述</label>
				<div class="layui-input-block">
					<textarea name="remark" placeholder="请输入描述" class="layui-textarea" v-model="item.remark"></textarea>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="button" class="offer" value="立即提交" @click="submit">
					<div class="return" onclick="history.back()" style="margin-top: 0 !important;">取消</div>
				</div>
			</div>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/scriptZIP/dayjs.min.js"></script>

	<script src="/scriptZIP/dayjs.min.js"></script>

	
	

	<script src="/lib/laydate/laydate.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/item.js"></script>

	<script>
		var app = new Vue(merge({
			data: {
				item: {
					startTime: null,
					endTime: null,
					schoolId: top_params().id
				},
				fee: null,
				url: '/pc/charge',
			},
			methods: {
				formatData: function (data) {
					this.fee = data.fee / 100;
				},
				fillData: function () {
					this.item.fee = (this.fee * 100).toFixed(0);
					if (this.item.fee <= 0) {
						alert('费用应大于0');
						throw 'err';
					}
				}
			},
			computed: {
				period: function () {
					if (!this.item.startTime || !this.item.endTime) return;
					return this.item.startTime + ' - ' + this.item.endTime;
				}
			}
		}));

		laydate.render({
			elem: '#time',
			type: 'datetime',
			range: true,
			done: function (value, date, endDate) {
				var a = value.split(' - ');
				app.item.startTime = a[0];
				app.item.endTime = a[1];
			}
		});

	</script>
</body>

</html>